<?php
/**
 * 后台公共 Action
 */
include LIBRARY_PATH . 'ORG/Util/SysUtil.class.php';
class YAction extends Action {
	protected $adminId = -1;  // 后台人员
	
	public function __construct() {
		parent::__construct();
			
		global $_G;
		
		// 自己
		$_G['adminUser'] = isset($_SESSION['adminUser']) ? $_SESSION['adminUser'] : null;
		$_G['adminId'] = isset($_SESSION['adminUser']) ? $_SESSION['adminUser']['id'] : -1;
		$this->adminId = intval($_G['adminId']);
	}
	
	protected function chkLogin($redirectPage = '') {
		if(!is_numeric($this->adminId) || $this->adminId <= 0) {
			if(!empty($redirectPage)) {
				$this->display($redirectPage);
			} 
			
			exit;
		}
	}
	protected function isLogin() {
		$f = false;
		if(is_numeric($this->adminId) && $this->adminId >= 0) {
			$f = true;
		}
		return $f;
	}
}
